#include<iostream>
#include<algorithm>
#include<bitset>
#include<vector>
using namespace std;
const int N = 110;
int n, m;
int a[N];
int main()
{
	cin >> n >> m;
	vector<bitset<110>>F(n + 1);
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		int z;
		cin >> z;
		while (z--) {
			int x;
			cin >> x;
			F[i][x - 1] = 1;
		}
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			//if (i == j)continue;
			if (a[i] <= a[j] && ((F[i] & F[j]) == F[j]) && (a[i] < a[j] || F[i] != F[j])) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
	return 0;
}